#include "debug_prt.h"
#include "string.h"
#include "globaldef.h"


extern uint8_t getLowPowerSta(void);

#if _En_Debug_Prt


//真正电路板是串口2，现在用其它电路板调试，使用串口0
#define debug_prt_usart	USART0




/* retarget the C library printf function to the USART */
int fputc(int ch, FILE *f)
{
	#if _EN_DisableUartWhenSleep
	if (getLowPowerSta() == 0x01)
	{
		return ch;
	}
	#endif
	
  usart_data_transmit(debug_prt_usart, (uint8_t)ch);
  while(RESET == usart_flag_get(debug_prt_usart, USART_FLAG_TBE));
	
  return ch;
}


	
#endif








